package com.srmt.document.model;

import java.io.Serializable;
import java.util.Date;
import java.util.Objects;

/**
 * 文档基本信息
 * 
 * @author YourCompany
 * @since 1.0.0
 */
public class DocumentInfo implements Serializable {
    
    private static final long serialVersionUID = 1L;
    
    /**
     * 文档ID
     */
    private String documentId;
    
    /**
     * 文档标题
     */
    private String title;
    
    /**
     * 文档URL
     */
    private String url;
    
    /**
     * 创建者ID
     */
    private String creatorId;
    
    /**
     * 创建者名称
     */
    private String creatorName;
    
    /**
     * 创建时间
     */
    private Date createdAt;
    
    /**
     * 最后修改时间
     */
    private Date updatedAt;
    
    /**
     * 最后修改者ID
     */
    private String lastModifierId;
    
    /**
     * 最后修改者名称
     */
    private String lastModifierName;
    
    /**
     * 文档大小（字节）
     */
    private Long size;
    
    /**
     * 文档类型
     */
    private String documentType;
    
    /**
     * 文档状态
     */
    private String status;
    
    /**
     * 父文件夹ID
     */
    private String parentFolderId;
    
    /**
     * 是否被删除
     */
    private Boolean deleted;
    
    /**
     * 版本号
     */
    private String version;
    
    // 构造函数
    public DocumentInfo() {
    }
    
    // Builder构造函数
    private DocumentInfo(Builder builder) {
        this.documentId = builder.documentId;
        this.title = builder.title;
        this.url = builder.url;
        this.creatorId = builder.creatorId;
        this.creatorName = builder.creatorName;
        this.createdAt = builder.createdAt;
        this.updatedAt = builder.updatedAt;
        this.lastModifierId = builder.lastModifierId;
        this.lastModifierName = builder.lastModifierName;
        this.size = builder.size;
        this.documentType = builder.documentType;
        this.status = builder.status;
        this.parentFolderId = builder.parentFolderId;
        this.deleted = builder.deleted;
        this.version = builder.version;
    }
    
    // Getters and Setters
    public String getDocumentId() {
        return documentId;
    }
    
    public void setDocumentId(String documentId) {
        this.documentId = documentId;
    }
    
    public String getTitle() {
        return title;
    }
    
    public void setTitle(String title) {
        this.title = title;
    }
    
    public String getUrl() {
        return url;
    }
    
    public void setUrl(String url) {
        this.url = url;
    }
    
    public String getCreatorId() {
        return creatorId;
    }
    
    public void setCreatorId(String creatorId) {
        this.creatorId = creatorId;
    }
    
    public String getCreatorName() {
        return creatorName;
    }
    
    public void setCreatorName(String creatorName) {
        this.creatorName = creatorName;
    }
    
    public Date getCreatedAt() {
        return createdAt;
    }
    
    public void setCreatedAt(Date createdAt) {
        this.createdAt = createdAt;
    }
    
    public Date getUpdatedAt() {
        return updatedAt;
    }
    
    public void setUpdatedAt(Date updatedAt) {
        this.updatedAt = updatedAt;
    }
    
    public String getLastModifierId() {
        return lastModifierId;
    }
    
    public void setLastModifierId(String lastModifierId) {
        this.lastModifierId = lastModifierId;
    }
    
    public String getLastModifierName() {
        return lastModifierName;
    }
    
    public void setLastModifierName(String lastModifierName) {
        this.lastModifierName = lastModifierName;
    }
    
    public Long getSize() {
        return size;
    }
    
    public void setSize(Long size) {
        this.size = size;
    }
    
    public String getDocumentType() {
        return documentType;
    }
    
    public void setDocumentType(String documentType) {
        this.documentType = documentType;
    }
    
    public String getStatus() {
        return status;
    }
    
    public void setStatus(String status) {
        this.status = status;
    }
    
    public String getParentFolderId() {
        return parentFolderId;
    }
    
    public void setParentFolderId(String parentFolderId) {
        this.parentFolderId = parentFolderId;
    }
    
    public Boolean getDeleted() {
        return deleted;
    }
    
    public void setDeleted(Boolean deleted) {
        this.deleted = deleted;
    }
    
    public String getVersion() {
        return version;
    }
    
    public void setVersion(String version) {
        this.version = version;
    }
    
    // Builder Pattern
    public static Builder builder() {
        return new Builder();
    }
    
    public static class Builder {
        private String documentId;
        private String title;
        private String url;
        private String creatorId;
        private String creatorName;
        private Date createdAt;
        private Date updatedAt;
        private String lastModifierId;
        private String lastModifierName;
        private Long size;
        private String documentType;
        private String status;
        private String parentFolderId;
        private Boolean deleted;
        private String version;
        
        public Builder documentId(String documentId) {
            this.documentId = documentId;
            return this;
        }
        
        public Builder title(String title) {
            this.title = title;
            return this;
        }
        
        public Builder url(String url) {
            this.url = url;
            return this;
        }
        
        public Builder creatorId(String creatorId) {
            this.creatorId = creatorId;
            return this;
        }
        
        public Builder creatorName(String creatorName) {
            this.creatorName = creatorName;
            return this;
        }
        
        public Builder createdAt(Date createdAt) {
            this.createdAt = createdAt;
            return this;
        }
        
        public Builder updatedAt(Date updatedAt) {
            this.updatedAt = updatedAt;
            return this;
        }
        
        public Builder lastModifierId(String lastModifierId) {
            this.lastModifierId = lastModifierId;
            return this;
        }
        
        public Builder lastModifierName(String lastModifierName) {
            this.lastModifierName = lastModifierName;
            return this;
        }
        
        public Builder size(Long size) {
            this.size = size;
            return this;
        }
        
        public Builder documentType(String documentType) {
            this.documentType = documentType;
            return this;
        }
        
        public Builder status(String status) {
            this.status = status;
            return this;
        }
        
        public Builder parentFolderId(String parentFolderId) {
            this.parentFolderId = parentFolderId;
            return this;
        }
        
        public Builder deleted(Boolean deleted) {
            this.deleted = deleted;
            return this;
        }
        
        public Builder version(String version) {
            this.version = version;
            return this;
        }
        
        public DocumentInfo build() {
            return new DocumentInfo(this);
        }
    }
    
    @Override
    public boolean equals(Object o) {
        if (this == o) return true;
        if (o == null || getClass() != o.getClass()) return false;
        DocumentInfo that = (DocumentInfo) o;
        return Objects.equals(documentId, that.documentId);
    }
    
    @Override
    public int hashCode() {
        return Objects.hash(documentId);
    }
    
    @Override
    public String toString() {
        return "DocumentInfo{" +
                "documentId='" + documentId + '\'' +
                ", title='" + title + '\'' +
                ", url='" + url + '\'' +
                ", creatorName='" + creatorName + '\'' +
                ", createdAt=" + createdAt +
                ", updatedAt=" + updatedAt +
                ", status='" + status + '\'' +
                '}';
    }
}